#include<stdio.h>
#include<math.h>

void main()
{
	int i, temp, sum;

	for(i = 100 ; i <= 999 ; i++)
	{
		temp = i;
		sum = 0;
		while(temp>0)
		{
			sum += (temp % 10)*(temp % 10)*(temp % 10);
			temp = temp / 10;
		}
		if(i == sum)
		{
			printf("%d\n",i);
		}
	}
}
